<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_sys_class('form','',0);

/**
 * 留言模块
 */
class message extends admin {
	private $messageDb;
	public $siteid;
	public $catid = 7;
	function __construct() {
        parent::__construct();
		$this->messageDb = pc_base::load_model('epaper_message_model');
		$this->siteid = $this->get_siteid();
	}
	
	public function list() {
		$datas = $this->messageDb->listinfo([],'id desc',$_GET['page']);
		$pages = $this->messageDb->pages;
        // $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=epaper&c=message&a=add\', title:\'添加数字报\', width:\'780\', height:\'500\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', '添加数字报');
		include $this->admin_tpl('message_list');
    }


	public function delete(){
		$id = (int)$_GET['id'];
		$one = $this->messageDb->get_one(['id'=>$id]);
		if(!$one)
			showmessage('发生错误！不存在 epaper_upload:'.$id);

		// 删除目录
		$this->messageDb->delete(['id'=>$id]);

		showmessage(L('operation_success'));
	}

}
